package cn.zwk.member.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
@Slf4j
@RefreshScope   //nacos配置热更新注解。也可以放到@ConfigurationProperties中
public class TestController {

    @Value("${nacos.test-val}")
    private String name;
    @RequestMapping("/hello")
    public String test(){
        log.info("name:{}",name);
        return "hello:"+name;
    }
}
